<?php
/**
 * @author Sonnk
 * @copyright 2011
 */
 
class incTimkiembds extends CI_Include
{
	function __construct()
	{
	    parent::__construct();
		//$this->load->incModel();
        $data->loaitins = $this->model->table('sa_loaitin')->select('id,tieude')->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		$data->loainhadats = $this->model->table('sa_loainhadat')->select('id,tieude')->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		$data->tinhthanhs = $this->model->table('sa_tinhthanh')->select('id,tieude')->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		$data->dientichs = $this->model->table('sa_dientich')->select('id,tieude')->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		$data->mucgias = $this->model->table('sa_mucgia')->select('id,tieude')->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		
		$searchBDS = $this->load->pub->GetSession('searchBDS');
		
		$data->loaitin = "";
		if(isset($searchBDS['loaitin']))
			$data->loaitin = $searchBDS['loaitin'];
		
		$data->loainhadat = "";
		if(isset($searchBDS['loainhadat']))
			$data->loainhadat = $searchBDS['loainhadat'];
		
		$data->tinhthanh = "";
		$tts = "";
		if(isset($searchBDS['tinhthanh']))
		{
			$tts = $searchBDS['tinhthanh'];
			$data->tinhthanh = $tts;
		}
		
		$data->quanhuyen = "";
		if(isset($searchBDS['quanhuyen']))
			$data->quanhuyen = $searchBDS['quanhuyen'];
		
		$data->dientich = "";
		if(isset($searchBDS['dientich']))
			$data->dientich = $searchBDS['dientich'];
		
		$data->mucgia = "";
		if(isset($searchBDS['mucgia']))
			$data->mucgia = $searchBDS['mucgia'];
		//$this->load->incLang($this->site->lang);
		$data->quanhuyens = $this->model->table('sa_quanhuyen')->select('id,tieude')->where('tinhthanh',$tts)->where('hienthi',1)->order_by('vitri','DESC')->find_all();
		
		$this->load->incView($data);
	}
}